<?php
if (isset($res_hist)) {
    if (!mysqli_num_rows($res_hist)) { ?>
        <div class="alert alert-warning center-block text-center half-size">
            Vous n'avez pas encore lu un article.
        </div>
    <?php }
    while ($row_hist = mysqli_fetch_array($res_hist)) { ?>
    <div class="list-article clearfix">
		<?php if(isset($row_hist['link']) && $row_hist['imgStatus'] != 3) { ?>
				<img src="<?= imgLink($row_hist['link']) ?>" />
		<?php } else { ?>
				<img src="<?= imgLink("img/blockedImg.png") ?>" />
		<?php }?>
        <div>
            <div class="clearfix">
                <h2 class="pull-left"><a href="<?= WEBROOT ?>article/article.php?id=<?= $row_hist['id'] ?>" ><?php if(isset($row_hist['title'])) { echo $row_hist['title']; } ?></a></h2>
                <div class="note pull-right">
                    <?= colorNote($row_hist['note']) ?>
                </div>
            </div>
            <div>
                <a href="<?= WEBROOT ?>user/user.php?id=<?= $row_hist['autorID'] ?>"><?php if(isset($row_hist['autor'])) { echo $row_hist['autor']; } ?></a>
                <span>&emsp;&mdash;&emsp;</span>
                <?php if(isset($row_hist['date'])) { echo strftime("le %d %B %Y à %H:%M:%S",strtotime($row_hist['date'])); } ?>
                <span>&emsp;&mdash;&emsp;</span>
                <?php if(isset($row_hist['type'])) { echo $row_hist['type']; } ?>
            </div>
            <div>
                <?php if(isset($row_hist['content'])) { echo substr($row_hist['content'], 0, 200)."..."; } ?></p>
            </div>
        </div>

    </div>

<?php }
 } ?>